﻿@page "/dotnetconf"

<Alert Header="It is time to focus on Blazor"
       OnDismissing="DissingAlert"
       OnDismissed="DismissedAlert"
       @ref="alert">
    <p class="mb-0">.NET Conf: Focus on Blazor is a free, one-day livestream event that features speakers from the community and .NET product teams that are working on building web apps with C# and Blazor. You don't need to use JavaScript anymore with Blazor technology! Blazor lets you build interactive web UIs using C# instead of JavaScript.</p>
</Alert>

<h1>Hello .NET Conf</h1>
<p><button @onclick="_ => alert?.Dismiss()" class="btn btn-primary">Dismiss alert</button></p>
<h3>Alert status:</h3>
<ol>
    @foreach (var msg in dismissMessages)
    {
        <li class="h4">@msg</li>
    }
</ol>

@code {
    Alert? alert;
    private List<string> dismissMessages = new List<string>();

    private void DissingAlert(DismissingEventArgs dismissingEvent)
    {
        dismissMessages.Add($"Alert Dismissing");
    }

    private void DismissedAlert(Alert dismissedAlert)
    {
        dismissMessages.Add($"Alert Dismissed");
    }
}